﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Infrastructure.Utility.Core.RabbitMq
{
    public class ConnectionConfiguration
    {
        public ConnectionConfiguration()
        {
            this.Port = (ushort)5672;
            this.VHost = "/";
            this.UserName = "guest";
            this.Password = "guest";
            this.Timeout = (ushort)30;
            this.Durable = true;
            this.MaxConnectionCount = 1000;
            this.MaxConnectionUsingCount = 100000;
        }
        /// <summary>
        /// //IP地址
        /// </summary>
        public string Server { get; set; }
        /// <summary>
        /// 交换机
        /// </summary>
        public string VHost { get; set; }
        /// <summary>
        /// 用户账号
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// 用户密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// 交换器
        /// </summary>
        public string Exchange { get; set; }
        /// <summary>
        /// 队列
        /// </summary>
        public string QueueName { get; set; }
        /// <summary>
        /// 路由
        /// </summary>
        public string RouteKey { get; set; }
        /// <summary>
        /// 端口号
        /// </summary>
        public ushort Port { get; set; }
        /// <summary>
        /// 是否持久化
        /// </summary>
        public bool Durable { get; set; }
        /// <summary>
        /// 执行操作超时时间
        /// </summary>
        public ushort Timeout { get; set; }
        /// <summary>
        /// 默认最大保持可用连接数
        /// </summary>
        public int MaxConnectionCount { get; set; }
        /// <summary>
        /// 默认最大连接可访问次数
        /// </summary>
        public int MaxConnectionUsingCount { get; set; }
    }
}
